package com.example.figurehecheng.controller.user;


import com.example.figurehecheng.common.result.Result;
import com.example.figurehecheng.domain.vo.HumanityVO;
import com.example.figurehecheng.service.IHumanityService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 人文关系表 前端控制器
 * </p>
 *
 * @author author
 * @since 2025-04-18
 */
@RestController("userHumanityController")
@RequestMapping("/user/humanity")
public class HumanityController {
    @Autowired
    private IHumanityService humanityService;

    /**
     * 获取人文列表
     * @return
     */
    @GetMapping("/list")
    @ApiOperation(value = "获取人文列表")
    public Result<List<HumanityVO>> getHumanityList(){
        List<HumanityVO> list = humanityService.getHumanityList();
        return Result.success(list);
    }

    /**
     * 获取人文详情
     * @param id
     * @return
     */
    @GetMapping("/detail")
    public Result<HumanityVO> getHumanityDetail(Long id){
        HumanityVO humanityVO = humanityService.getHumanityDetail(id);
        return Result.success(humanityVO);
    }
}
